/**
 * jims
 */
package com.jims.master.modules.csm.dao;

import com.jims.master.common.persistence.CrudDao;
import com.jims.master.common.persistence.annotation.MyBatisDao;
import com.jims.master.common.web.impl.BaseDto;
import com.jims.master.modules.csm.entity.ExpExportDetail;
import com.jims.master.modules.csm.entity.ExpInfo;
import com.jims.master.modules.csm.entity.ExpStock;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 消耗品出库明细DAO接口
 * @author fengyg
 * @version 2017-03-16
 */
@MyBatisDao
public interface ExpExportDetailDao extends CrudDao<ExpExportDetail> {

    /**
     * 消耗品出库选择有库存有价格的消耗品自动补全(当前库房)
     * @param expInfo 消耗品基本信息
     * @param orgId 组织机构ID
     * @param storageId 库房ID
     * @return
     * @author fengyg
     * @date 2017-03-17
     */
    public List<ExpExportDetail> autoExportStock(@Param("expInfo") ExpInfo expInfo, @Param("orgId") String orgId, @Param("q") String q, @Param("limit") String limit, @Param("storageId") String
            storageId);

    /**
     * 根据供货方ID(storageId)查询需要批量入库的数据
     * @param storageId 供货方ID
     * @param receiver 收货方ID
     * @param orgId 组织机构ID
     * @return
     * @author fengyg
     */
    public List<ExpStock> getBatchImportList(@Param("storageId") String storageId, @Param("receiver") String receiver, @Param("orgId") String orgId);

    /**
     * 出库详情查询(出库单查询，根据出库主记录ID查询出库详情)
     * @param expExportDetail
     * @return
     */
    public List<ExpExportDetail> findBymasterId(ExpExportDetail expExportDetail);

    /**
     * 出库记录查询
     * @param expExportDetail
     * @return
     */
    public List<ExpExportDetail> findDetailList(ExpExportDetail expExportDetail);

    /**
     * 消耗品出库单据打印
     * @param expExportDetail
     * @return
     */
    public List<BaseDto> findDetailListPrint(ExpExportDetail expExportDetail);

    /**
     * 打印品种数量统计
     * @param expExportDetail
     * @return
     */
    public ExpExportDetail findNumByName(ExpExportDetail expExportDetail);

}